﻿@using BrnMall.Manager.Domain.Distribution
@using BrnMall.Web.StoreAdmin.Models
@model BrnMall.Web.StoreAdmin.Models.DistributorViewModel
@section header{
    <title>查看分销商-分销管理</title>
    <link type="text/css" rel="stylesheet" href="/admin_store/css/site.css" />
    <script type="text/javascript" src="/admin_store/scripts/jquery.js"></script>
    <script type="text/javascript" src="/admin_store/scripts/jquery.validate.js"></script>
    <script type="text/javascript" src="/admin_store/scripts/jquery.validate.unobtrusive.js"></script>
    <script type="text/javascript" src="/admin_store/scripts/showlist.js"></script>
    <style>
    .addTable{margin-bottom:0px;}
    .addTable table td {height:45px;}
    .box-info{width:100%;background-color:#F6F6F6}
    .left-info{width:69%;background-color:#fff;height:280px}
    .right-info{width:30%;background-color:#fff;height:280px;float:right}
    .info-title{width:100%;height:45px;line-height:45px}
    .info-title img{width:20px;height:20px;display:inline;vertical-align:middle;padding-left:15px}
    .info-title span{color:#FF8427;padding-left:10px}
    .item-title{margin-top:10px;padding-bottom:20px;float:left}
    .left-name{padding-left:15px;padding-bottom:30px}
    .item-title-right{float:left;margin-top:10px;margin-left:120px}

    .order-count{height:35px;width:80%;background-color:#FFE6D5;line-height:30px;color:#FF8427;margin-left:15px}
    .order-count span{padding-left:15px}
    .td-text { padding-left:20px;}
    </style>
}
@section body{
    <h1 class="rightH1 nav-fx">
        小程序分销 &gt; 分销管理 &gt; <span class="rightH1-cur">查看分销商信息</span>
        <div class="right">
            <a href="@Html.Raw(ViewData["referer"].ToString())" class="menuBT">返回列表</a>
            <div class="clear">
            </div>
        </div>
        <div class="clear">
        </div>
    </h1>

    <div class="addTable bg">
        <div class="right-info">
            <div class="info-title right-yeji">
                <img src="/admin_store/images/distributor/44.png" alt="">
                <span>业绩</span>
            </div>
            <div class="order-count"><span>成交单数 ：@Model.OrdersCount</span></div>
            <div class="order-count"><span>销售金额 ：@Model.OrdersTotal</span></div>
            <div class="order-count"><span>佣金总额 ：@(Model.AccountBalance + Model.RequestBalance+Model.PendingBalance)</span></div>
            <div class="order-count"><span>可提现佣金余额 ：@Model.AccountBalance</span></div>
            <div class="order-count"><span>已提现佣金总额 ：@Model.RequestBalance</span></div>
            <div class="order-count"><span>待发放佣金 ：@Model.PendingBalance</span></div>
        </div>

        <div class="left-info">
            <div class="info-title">
                <img src="/admin_store/images/distributor/43.png" alt="">
                <span>基本信息</span>
            </div>
            <table>
                <tr>
                    <td align="right">Logo：</</td>
                    <td class="td-text"><img src="@Model.ShowLogo" style="border-radius: 25px;" width="50" height="45" alt="" /></td>
                    <td style="width:46%;" align="right">状态：</td>
                    <td class="td-text">
                        @if (Model.Status == 0)
                        {
                            @:待审核
                    }
                        else if (Model.Status == 1)
                        {
                            @:已审核
                    }
                        else if (Model.Status == 2)
                        {
                            @:已关闭
                    }
                    </td>
                </tr>
                <tr>
                    <td align="right">用户编号：</td>
                    <td class="td-text">@Model.User.Uid</td>
                    <td align="right">用户名：</td>
                    <td class="td-text">@Model.User.UserName</td>

                </tr>
                <tr>
                    <td align="right">分销商名称：</td>
                    <td class="td-text">@Model.DisStoreName</td>
                    <td align="right">用户昵称：</td>
                    <td class="td-text">@Model.User.NickName</td>
                </tr>
                <tr>
                    <td align="right">等级：</td>
                    <td class="td-text">@Model.DisGrade.Name</td>
                    <td align="right">联系人：</td>
                    <td class="td-text">@Model.LinkMan</td>
                </tr>
                <tr>
                    <td align="right">联系电话：</td>
                    <td class="td-text">@Model.PhoneNumber</td>
                    <td width="150px" align="right">开通时间：</td>
                    <td class="td-text">@Model.CreateTime.ToString("yyyy-MM-dd")</td>
                </tr>
            </table>
        </div>
    
    </div>

<div class="table_bottom bg"></div>
<div class="dataList">
    <table width="100%">
        <thead>
            <tr>
                <th align="left">编号</th>
                <th align="left">团级别</th>
                <th align="left">头像</th>
                <th align="left" width="120">用户昵称</th>
                <th align="left" width="120">分销商名称</th>
                <th align="left">等级</th>
                <th align="left" width="120">联系人</th>
                <th align="left">联系电话</th>
                <th align="left">总销售额</th>
                <th align="left">可提现佣金</th>
                <th align="left">已提现</th>
                <th align="left">申请时间</th>
                <th align="left">状态</th>

            </tr>
        </thead>
        <tbody>
            @foreach (DistributorViewModel dis in Model.TeamList)
            {
                <tr>

                    <td align="left">@dis.Id</td>
                    <td align="left">@dis.DisLevel 级</td>
                    <td align="left"><img style="border-radius: 25px;" width="50" height="50" alt="" src="@dis.ShowLogo" /> </td>
                    <td align="left">@dis.User.NickName</td>
                    <td align="left">@dis.DisStoreName</td>
                    <td align="left">@dis.DisGrade.Name</td>
                    <td align="left">@dis.LinkMan</td>
                    <td align="left">@dis.PhoneNumber</td>
                    <td align="left">
                        @dis.OrdersTotal.ToString("0.00")
                    </td>
                    <td align="left">
                        @dis.AccountBalance.ToString("0.00")
                    </td>
                    <td align="left">
                        @dis.RequestBalance
                    </td>
                    <td>
                        @dis.CreateTime.ToString("yyyy-MM-dd")

                </td>
                <td align="left">
                    @if (dis.Status == 0)
                    {
                        @:待审核
                        }
                    else if (dis.Status == 1)
                    {
                        @:已审核
                        }
                    else if (dis.Status == 2)
                    {
                        @:已关闭
                        }
                </td>

            </tr>
            }
        </tbody>
    </table>
</div>
<div class="dataListEdit">
    @using (Html.BeginForm("ViewDistributor", "Distributor"))
    {
        @Html.HiddenFor(x => x.Id)
        <div class="page">
            @Html.MallAdminPager(Model.TeamPageModel)
        </div>
    }

</div>

<div class="table_bottom bg"></div>
<div class="dataList">
    <table width="100%">
        <thead>
            <tr>
                <th width="20">ID</th>
                <th align="left">申请时间</th>
                <th align="left">提现金额</th>
                <th align="left">帐号类型</th>
                <th align="left">帐号</th>
                <th align="left">收款人</th>
                <th align="left">支付日期</th>
            </tr>
        </thead>
        <tbody>
            @foreach (BrokerageRequest info in Model.BrokerageRequest)
            {
                <tr>
                    <td>@info.Id</td>
                    <td>@info.RequestTime.ToString("yyyy-MM-dd")</td>
                    <td>￥@info.Amount </td>
                    <td>微信企业转账</td>
                    <td>@info.RequestOpenId</td>
                    <td>@info.RequestUserRealName</td>
                    <td>@info.SendTime.ToString("yyyy-MM-dd HH:mm:ss")</td>
                </tr>
            }
        </tbody>
    </table>
</div>

<div class="dataListEdit">
    @using (Html.BeginForm("ViewDistributor", "Distributor"))
    {
        @Html.HiddenFor(x => x.Id)
        <div class="page">
            @Html.MallAdminPager(Model.PageModel)
        </div>
    }

</div>
}